function fig2_8

clf
% get(gcf)
set(gcf,'Position', [25 1115 658 230])
co = [0 0 1;
    0 0.5 0;
    1 0 0;
    0 0.75 0.75;
    0.75 0 0.75;
    0.75 0.75 0;
    0.25 0.25 0.25];
set(groot,'defaultAxesColorOrder',co)
subaxis(1,1,1,1,'MT',0.01,'MB',0.2,'MR',0.01,'ML',0.05,'P',0.04)

nt=100;
tmax=20;
t=linspace(1,tmax,nt);
tt=linspace(0.4,tmax,nt);

a0=-1; b0=1; r0=sqrt(2);
for i=1:nt
    y(i)=-(2^1.5*exp(-tt(i))/sqrt(pi))*int2(@(r)sqrt(r)*exp(r)*sin(tt(i)-r-pi/4),0,tt(i));
    %y(i)=-(2^1.5*exp(-t(i))/sqrt(pi))*integral(@(r)sqrt(r)*exp(r)*sin(t(i)-r-pi/4),r,0,t(i));
end

for i=1:nt
    Y1(i)=1/(r0^2*sqrt(pi*t(i)));
    Y2(i)=Y1(i)-a0/(r0^4*sqrt(pi*t(i)^3));
end

plot(tt,y,'--b','LineWidth',1.3,'MarkerSize',10)
hold on
plot(t,Y1,'--','Color',[11/256, 218/256, 81/256],'LineWidth',1,'MarkerSize',10)
plot(t,Y2,'--r','LineWidth',1,'MarkerSize',10)
%axis([0 xmax -0.5 0.6])

ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

box on
grid on
legend('\, Numerical','\, One Term','\, Two Terms\,\,\,','Location','NorthEast','FontSize',13,'Interpreter','latex','AutoUpdate','off')

% say=['$ t = 0.2$']; 
% text(0.1,0.02,say,'FontSize',13,'Interpreter', 'latex')

xlabel('$t$\,-\,axis','Interpreter','latex','FontSize',14)
ylabel('$y(t)$','Interpreter','latex','FontSize',14)

%exportgraphics(gcf,'/Users/mark/Desktop/Y.pdf')

















